﻿<!--#include file="h.asp"--><%
'
'	七色虎建站系统
'	论坛帖子回复页面
'	2011.11.2

Sub main
	Dim id,rs,sql,isAdmin,userid,body_,classid,authorid,content
	id=getN("id", 1)
	userid=user_array(0)
	hu.title = "网友跟帖"
	body_ = checkMsg()'信息
	body_ = body_ & "[div=nav]-" & hu.url("?aid=index","首页")&"-"&hu.url("bbs_posts.asp?id="&id,"查看帖子")&"-跟帖[/div]发表评论：<br/>"
	Dim formarray(2)
	formarray(0) = http_path&"bbs_reply.asp?id="&id&"||post||回复"
	formarray(1) = "input||text$$$$20$$"&numReplyMax&"||<br/>"
	formarray(2) = "hidden||id$$"&id&"||"&bbsSid&"$$"&sid&"||"
	body_ = body_ & hu.getForm(formarray) & " (支持"&hu.url("bbs_reply.asp?a=-1","UBB")&")<br/>[div=nav]※网友评论区[/div]"
	isAdmin=0
	classid=0
	If userid>0 Then
		' isAdmin=hu.conn("select count(t.id) from 74hu_topic t inner join 74hu_bbs c on(c.classid=t.classid) where c.host="&userid&" and t.id="&id)(0)
		Set rs=hu.conn("select top 1 c.classid,c.host from 74hu_topic t inner join 74hu_bbs c on(c.classid=t.classid) where t.id="&id)
		If Not rs.eof Then
			If userid=rs("host") Then isAdmin = 1
			classid = rs("classid")
		End If
	End If
	sql = "select r.id,r.userid,r.content,r.savetime,u.name from 74hu_reply r inner join 74hu_user u on r.userid=u.id where r.postid="&id&" order by r.id desc"
	Set rs = Server.CreateObject("ADODB.Recordset")
	rs.open sql, hu.db, 1, 1
	If Not rs.eof Then
		Dim pagesize,count,page,pagecount,i,rid
		pagesize=10
		count = rs.recordcount
		page=getN("page",1)
		if page<=0 then page=1
		pagecount=(count+pagesize-1)\pagesize
		if page>pagecount then page=pagecount
		rs.move(pagesize*(page-1))
		For i=1 To PageSize
			If rs.eof Then Exit For
			rid=rs("id")
			authorid=rs("userid")
			content=rs("content")
			If Not ifUserNormal(authorid) Then content = "用户信息被系统屏蔽"
			body_ = body_ & "[div=odd]"&count-(page-1)*pagesize-i+1 &"楼."&hu.url("bbs_user.asp?id="&authorid, rs("name"))&_
				" " &fordate2(rs("savetime")) &"[/div][div=even]"& replyUbb(content) & "[/div]"
			If isAdmin<>0 Then body_ = body_ & "管理:"&hu.url("bbs_reply.asp?id="&rid&"&amp;a=1&amp;pid="&id,"编辑")&"."&_
				hu.url("bbs_reply.asp?id="&rid&"&amp;a=2&amp;pid="&id,"删除")&"<br/>"
			rs.movenext
		Next
		body_ = body_ & showPage("bbs_replys.asp", "id:"&id, page, pagecount)&""
	Else
		body_ = body_ & "暂时没有回复!<br/>"
	End If
	body_ = body_ & "" & hu.url("bbs_posts.asp?id="&id,"返回帖子")
	If classid<>0 Then body_ = body_ & " " & hu.url("bbs_topic.asp?id="&classid,"返回上级栏目")
	rs.close
	Set rs=Nothing
	hu.body = comUbb(body_)
End Sub

%>